package cn.itcast.dao;

import cn.itcast.pojo.PayLog;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface PaylogDao {
    /**
     *
     * 新增订单支付信息
     * @param payLog
     * @return
     */
    @Insert("insert into t_paylog values(#{orderId},#{transactionId},#{money},#{payStatus},#{payTime},#{createTime})")
    public int add(PayLog payLog);

    /**
     * 根据订单id查询日志信息
     * @param orderId
     * @return
     */
    @Select("select * from t_paylog where orderId = #{orderId}")
    PayLog findByOrderId(String orderId);

    /**
     *更新订单支付状态
     * @param payLog
     */
    @Update("update t_paylog set transactionId = #{transactionId},payStatus = #{payStatus},payTime = #{payTime} where orderId = #{orderId}")
    void updateByOrderId(PayLog payLog);
}
